package com.lc.hongtai.activity;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lc.hongtai.R;

/**
 * Created by Administrator on 2017/4/20.
 */
public class ContactActivity extends BaseActivity implements View.OnClickListener {


    private ImageView iv_back;

    //打电话
    private TextView text_phone;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contactus);
        iv_back = (ImageView) findViewById(R.id.iv_back);

        iv_back.setOnClickListener(this);

        text_phone = (TextView) findViewById(R.id.text_phone);
        text_phone.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        switch (view.getId()) {
            case R.id.iv_back:

                finish();
                break;

            case R.id.text_phone:
                Intent intent = new Intent(Intent.ACTION_CALL);
                Uri data = Uri.parse("tel:" + text_phone.getText().toString());
                intent.setData(data);
                startActivity(intent);

                break;

        }
    }
}
